package com.woniuxy.config;


import org.springframework.stereotype.Component;
import springfox.documentation.swagger.web.SwaggerResource;
import springfox.documentation.swagger.web.SwaggerResourcesProvider;

import java.util.Arrays;
import java.util.List;

@Component
public class ResourcesProvider implements SwaggerResourcesProvider {

    @Override
    public List<SwaggerResource> get() {
        return Arrays.asList(
                createSwaggerResource("用户","/user/v2/api-docs","2.0")
        );
    }

    public SwaggerResource createSwaggerResource(String name,String url,String version){
        SwaggerResource resource = new SwaggerResource();
        resource.setName(name);
        resource.setUrl(url);
        resource.setSwaggerVersion(version);
        return resource;
    }
}
